(N/A) Consider a magnetic needle of magnetic dipole moment $\vec{m}$ placed in a uniform magnetic field $\vec{B}$.
The forces acting on the poles $N$ and $S$ are equal and opposite,forming a couple that exerts a torque $\vec{\tau}$ on the needle.
The torque is given by $\vec{\tau} = \vec{m} \times \vec{B}$.
Thus,the magnitude of the torque is $\tau = mB \sin \theta$,where $\theta$ is the angle between $\vec{m}$ and $\vec{B}$.
Since this torque acts to restore the needle to its equilibrium position,we can write the restoring torque as $\tau = -mB \sin \theta$.
Using Newton's second law for rotation,$\tau = I \alpha = I \frac{d^2 \theta}{dt^2}$,where $I$ is the moment of inertia.
Equating the two expressions for torque: $I \frac{d^2 \theta}{dt^2} = -mB \sin \theta$.
For small oscillations,$\sin \theta \approx \theta$,so $I \frac{d^2 \theta}{dt^2} = -mB \theta$.
Rearranging gives $\frac{d^2 \theta}{dt^2} = -\left( \frac{mB}{I} \right) \theta$.
This is the equation of simple harmonic motion,$\frac{d^2 \theta}{dt^2} = -\omega^2 \theta$,where $\omega^2 = \frac{mB}{I}$.
Therefore,the angular frequency is $\omega = \sqrt{\frac{mB}{I}}$.
Since $\omega = \frac{2\pi}{T}$,we have $\frac{2\pi}{T} = \sqrt{\frac{mB}{I}}$.
Solving for $T$,we get $T = 2\pi \sqrt{\frac{I}{mB}}$.